package com.etheart.music.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.etheart.framework.core.fulltextsearch.IndexService;
import com.etheart.model.entity.Album;
import com.etheart.model.entity.Singer;
import com.etheart.model.entity.Song;

@Service("music_MusicIndexService")
public class MusicIndexServiceImp implements MusicIndexService {
	@Autowired
	private IndexService indexService;
	
	
	@Transactional
	public <T> void indexAllSinger() {
		indexService.index(Singer.class);
	}
	
	@Transactional
	public <T> void indexSinger(int id) {
		indexService.index(Singer.class,id);
	}

	@Transactional
	public <T> void purgeAllSinger() {
		indexService.purgeAll(Singer.class);
	}

	@Transactional
	public void indexAllAlbum() {
		indexService.index(Album.class);
	}

	@Transactional
	public void indexAllSong() {
		indexService.index(Song.class);
	}

	@Transactional
	public void purgeAllAlbum() {
		indexService.purgeAll(Album.class);
	}

	@Transactional
	public void purgeAllSong() {
		indexService.purgeAll(Song.class);
	}


}
